//盛水最多的容器（medium）
public class maxArea {
    public int maxArea(int[] height) {
        int left = 0;
        int right = height.length - 1;
        int v = -1;
        while(right > left){
            if(height[right]>height[left]){
                int vN = (right-left) * height[left];
                left += 1;
                if(vN > v){
                    v = vN;
                }
            } else {
                int vN = (right-left) * height[right];
                right -= 1;
                if(vN > v){
                    v = vN;
                }
            }
        }
        return v;
    }
}
